// class="loading-cube" loading立方
.loading-cube {
  --size: 10px;
  --color: white;
  width: 20px;
  height: 20px;
  position: relative;
}

.loading-cube::after,
.loading-cube::before {
  box-sizing: border-box;
  position: absolute;
  content: '';
  width: var(--size);
  height: var(--size);
  top: 50%;
  animation: loading-cube-up 2.4s cubic-bezier(0, 0, 0.24, 1.21) infinite;
  left: 50%;
  background: var(--color);
  box-shadow: 0 0 calc(var(--size) / 3) rgba(0, 0, 0, 0.25);
}

.loading-cube::after {
  background: var(--color);
  top: calc(50% - var(--size));
  left: calc(50% - var(--size));
  animation: loading-cube-down 2.4s cubic-bezier(0, 0, 0.24, 1.21) infinite;
}

@keyframes loading-cube-down {
  0%,
  100% {
    transform: none;
  }

  25% {
    transform: translateX(100%);
  }

  50% {
    transform: translateX(100%) translateY(100%);
  }

  75% {
    transform: translateY(100%);
  }
}

@keyframes loading-cube-up {
  0%,
  100% {
    transform: none;
  }

  25% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(-100%) translateY(-100%);
  }

  75% {
    transform: translateY(-100%);
  }
}

// class="loading-wireframe" loading线框
.loading-wireframe,
.loading-wireframe::before,
.loading-wireframe::after {
  border-width: 1px;
  border-style: solid;
  border-radius: 6px;
  animation: loading-wireframe-rotate 5s linear infinite;
}

.loading-wireframe {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  border-color: #5a4ff3;
}

.loading-wireframe::before,
.loading-wireframe::after {
  position: absolute;
  content: '';
}

.loading-wireframe::before {
  border-color: #35a2d2;
  width: 80%;
  height: 80%;
  animation-delay: 0.5s;
}

.loading-wireframe::after {
  border-color: #9c40fc;
  width: 120%;
  height: 120%;
  animation-delay: 0.1s;
}

@keyframes loading-wireframe-rotate {
  to {
    transform: rotate(360deg);
  }
}

// class="loading-point-circle" loading点圈
.loading-point-circle {
  width: 20px;
  height: 20px;
  border: 2px dotted #2a7fff;
  border-style: solid solid dotted dotted;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: loading-point-circle-rotation 2s linear infinite;
}
.loading-point-circle::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  border: 2px dotted #ff3d00;
  border-style: solid solid dotted;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: loading-point-circle-rotationBack 1s linear infinite;
  transform-origin: center center;
}

@keyframes loading-point-circle-rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes loading-point-circle-rotationBack {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

// class="loading-jing" loading井字
.loading-jing {
  position: relative;
  width: 2em;
  height: 2em;
  transform: rotate(165deg);
}

.loading-jing:before,
.loading-jing:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 0.25em;
  transform: translate(-50%, -50%);
}

.loading-jing:before {
  animation: before8 2s infinite;
}

.loading-jing:after {
  animation: after6 2s infinite;
}

@keyframes before8 {
  0% {
    width: 0.5em;
    box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
  }

  35% {
    width: 2.5em;
    box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75), 0 0.5em rgba(111, 202, 220, 0.75);
  }

  70% {
    width: 0.5em;
    box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75), 1em 0.5em rgba(111, 202, 220, 0.75);
  }

  100% {
    box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
  }
}

@keyframes after6 {
  0% {
    height: 0.5em;
    box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
  }

  35% {
    height: 2.5em;
    box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75), -0.5em 0 rgba(233, 169, 32, 0.75);
  }

  70% {
    height: 0.5em;
    box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75), -0.5em 1em rgba(233, 169, 32, 0.75);
  }

  100% {
    box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
  }
}

// class="loading-image" loading图片
.loading-image {
  width: 64px;
  height: 64px;
  position: relative;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.loading-image:before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 40px;
  transform: rotate(45deg) translate(30%, 40%);
  background: #933c3c;
  box-shadow: 32px -34px 0 5px #650a0a;
  animation: loading-image-slide 2s infinite ease-in-out alternate;
}

.loading-image:after {
  content: '';
  position: absolute;
  left: 10px;
  top: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #650a0a;
  transform: rotate(0deg);
  transform-origin: 35px 145px;
  animation: loading-image-rotate 2s infinite ease-in-out;
}

@keyframes loading-image-slide {
  0%,
  100% {
    bottom: -35px;
  }

  25%,
  75% {
    bottom: -2px;
  }

  20%,
  80% {
    bottom: 2px;
  }
}

@keyframes loading-image-rotate {
  0% {
    transform: rotate(-15deg);
  }

  25%,
  75% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(25deg);
  }
}

// class="loading-slg" loading手里干
.loading-slg {
  width: 40px;
  height: 40px;
  color: #0000f4;
  background: conic-gradient(from 165deg at top, #0000, currentColor 1deg 30deg, #0000 31deg) top,
    conic-gradient(from 75deg at left, #0000, currentColor 1deg 30deg, #0000 31deg) left,
    conic-gradient(from -15deg at bottom, #0000, currentColor 1deg 30deg, #0000 31deg) bottom,
    conic-gradient(from -105deg at right, #0000, currentColor 1deg 30deg, #0000 31deg) right;
  background-size: 100% 50%, 50% 100%;
  -webkit-mask: radial-gradient(circle 4px, #0000 90%, #000);
  background-repeat: no-repeat;
  animation: loading-slg-sh1 1.5s infinite linear;
}

@keyframes loading-slg-sh1 {
  100% {
    transform: rotate(1turn);
  }
}

// class="loading-pokemon" loading精灵球
.loading-pokemon {
  height: 40px;
  aspect-ratio: 1;
  position: relative;
}

.loading-pokemon::before,
.loading-pokemon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform-origin: bottom;
}

.loading-pokemon::after {
  background: radial-gradient(at 75% 15%, #fffb, #0000 35%),
    radial-gradient(at 80% 40%, #0000, #0008), radial-gradient(circle 4px, #fff 94%, #0000),
    radial-gradient(circle 8px, #000 94%, #0000),
    linear-gradient(#f93318 0 0) top / 100% calc(50% - 2px),
    linear-gradient(#fff 0 0) bottom/100% calc(50% - 2px) #000;
  background-repeat: no-repeat;
  animation: loading-pokemon-shake 1s infinite cubic-bezier(0.5, 120, 0.5, -120);
}

.loading-pokemon::before {
  background: #ddd;
  filter: blur(8px);
  transform: scaleY(0.4) translate(-13px, 0px);
}

@keyframes loading-pokemon-shake {
  30%,
  70% {
    transform: rotate(0deg);
  }

  49.99% {
    transform: rotate(0.2deg);
  }

  50% {
    transform: rotate(-0.2deg);
  }
}

// class="loading-empty1" loading暂无数据 1
.loading-empty1 {
  width: fit-content;
  font-weight: bold;
  font-family: monospace;
  font-size: 30px;
  background: radial-gradient(circle closest-side, #000 94%, #0000) right/calc(200% - 1em) 100%;
  animation: loading-empty1-move 1s infinite alternate linear;
}

.loading-empty1::before {
  content: '暂无数据...';
  line-height: 1em;
  color: #0000;
  background: inherit;
  background-image: radial-gradient(circle closest-side, #fff 94%, #000);
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes loading-empty1-move {
  100% {
    background-position: left;
  }
}

// class="loading-empty2" loading暂无数据 2
.loading-empty2 {
  font-size: 48px;
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  color: #fff;
  letter-spacing: 2px;
  position: relative;
  box-sizing: border-box;
}

.loading-empty2::after {
  content: '暂无数据...';
  position: absolute;
  left: 0;
  top: 0;
  color: #263238;
  text-shadow: 0 0 2px #fff, 0 0 1px #fff, 0 0 1px #fff;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  animation: loading-empty2-animloader 6s linear infinite;
}

@keyframes loading-empty2-animloader {
  0% {
    height: 100%;
  }

  100% {
    height: 0%;
  }
}

// class="loading-empty3" loading暂无数据 3
.loading-empty3 {
  font: bold 200% Consolas, Monaco, monospace;
  border-right: 0.1em solid black;
  width: 11ch;
  margin: 2em 2em;
  white-space: nowrap;
  overflow: hidden;
  -webkit-animation: loading-empty3-typing 5s steps(13, end),
    loading-empty3-blink-caret 0.5s step-end infinite alternate;
}
@keyframes loading-empty3-typing {
  from {
    width: 0;
  }
}
@keyframes loading-empty3-blink-caret {
  50% {
    border-color: transparent;
  }
}

// class="loading-empty4" loading暂无数据 4
.loading-empty4 {
  color: transparent;
  font-size: 1.4rem;
  position: relative;
  overflow: hidden;
}

.loading-empty4::before {
  content: '暂无数据...';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  border-right: 4px solid #17feff;
  overflow: hidden;
  color: #17feff;
  animation: loading-empty4-load 2s linear infinite;
}

@keyframes loading-empty4-load {
  0%,
  10%,
  100% {
    width: 0;
  }

  10%,
  20%,
  30%,
  40%,
  50%,
  60%,
  70%,
  80%,
  90%,
  100% {
    border-right-color: transparent;
  }

  11%,
  21%,
  31%,
  41%,
  51%,
  61%,
  71%,
  81%,
  91% {
    border-right-color: #17feff;
  }

  60%,
  80% {
    width: 100%;
  }
}

// class="loading-empty5" loading暂无数据 5
.loading-empty5 {
  position: relative;
  font-family: sans-serif;
  display: flex;
  height: auto;
  width: auto;
  letter-spacing: 3px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-size: 1.45em;
  color: transparent;
  background: linear-gradient(to right, #fff 33.3%, #008cdd 33.3%, #008cdd 66.6%, #fff 66.6%)
    no-repeat;
  background-size: 300%;
  background-position: 100%;
  background-clip: text;
  -webkit-background-clip: text;
  animation: infinite 1.4s loading-empty5-load-loop ease;
}

.loading-empty5::after {
  content: '';
  width: 100%;
  height: 100%;
  position: absolute;
  display: block;
  background: linear-gradient(
      to right,
      #008cdd 33.3%,
      transparent 33.3%,
      transparent 66.6%,
      #008cdd 66.6%
    )
    no-repeat;
  background-size: 300%;
  background-position: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  animation: infinite 1.4s loading-empty5-load-loop ease;
}

@keyframes loading-empty5-load-loop {
  0% {
    background-position: 100%;
  }

  40% {
    background-position: 50%;
  }

  50% {
    background-position: 50%;
  }

  90% {
    background-position: 0%;
  }

  100% {
    background-position: 0%;
  }
}

// 故障文字动效
.glitch-text {
  position: relative;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 5px;
  z-index: 1;
  animation: glitch-text-shift 1s ease-in-out infinite alternate;
}

.glitch-text:before,
.glitch-text:after {
  display: block;
  content: attr(data-glitch);
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.8;
}

.glitch-text:before {
  animation: glitch-text-anim 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  color: #8b00ff;
  z-index: -1;
}

.glitch-text:after {
  animation: glitch-text-anim 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
  color: #00e571;
  z-index: -2;
}

@keyframes glitch-text-anim {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-4px, 4px);
  }

  40% {
    transform: translate(-4px, -4px);
  }

  60% {
    transform: translate(4px, 4px);
  }

  80% {
    transform: translate(4px, -4px);
  }

  to {
    transform: translate(0);
  }
}

@keyframes glitch-text-shift {
  0%,
  40%,
  44%,
  58%,
  61%,
  65%,
  69%,
  73%,
  100% {
    transform: skewX(0deg);
  }

  41% {
    transform: skewX(10deg);
  }

  42% {
    transform: skewX(-10deg);
  }

  59% {
    transform: skewX(40deg) skewY(10deg);
  }

  60% {
    transform: skewX(-40deg) skewY(-10deg);
  }

  63% {
    transform: skewX(10deg) skewY(-5deg);
  }

  70% {
    transform: skewX(-50deg) skewY(-20deg);
  }

  71% {
    transform: skewX(10deg) skewY(-10deg);
  }
}

// 故障按钮
.glitch-btn,
.glitch-btn::after {
  padding: 4px 8px;
  font-size: 16px;
  background: linear-gradient(45deg, transparent 5%, #ff013c 5%);
  border: 0;
  color: #fff;
  box-shadow: 6px 0px 0px #00e6f6;
  outline: transparent;
  position: relative;
  cursor: pointer;
}

.glitch-btn:active {
  opacity: 0.6;
  background: linear-gradient(45deg, transparent 5%, #c3002d 5%);
  box-shadow: 6px 0px 0px #4386a7;
}

.glitch-btn::after {
  content: attr(data-glitch);
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 3%, #00e6f6 3%, #00e6f6 5%, #ff013c 5%);
  text-shadow: -3px -3px 0px #f8f005, 3px 3px 0px #00e6f6;
  clip-path: inset(50% 50% 50% 50%);
}

.glitch-btn:hover::after {
  animation: 1s glitch-btn-anim;
  animation-timing-function: steps(2, end);
}

@keyframes glitch-btn-anim {
  0% {
    clip-path: inset(80% -6px 0 0);
    transform: translate(-20px, -10px);
  }

  10% {
    clip-path: inset(10% -6px 85% 0);
    transform: translate(10px, 10px);
  }

  20% {
    clip-path: inset(80% -6px 0 0);
    transform: translate(-10px, 10px);
  }

  30% {
    clip-path: inset(10% -6px 85% 0);
    transform: translate(0px, 5px);
  }

  40% {
    clip-path: inset(50% -6px 30% 0);
    transform: translate(-5px, 0px);
  }

  50% {
    clip-path: inset(10% -6px 85% 0);
    transform: translate(5px, 0px);
  }

  60% {
    clip-path: inset(40% -6px 43% 0);
    transform: translate(5px, 10px);
  }

  70% {
    clip-path: inset(50% -6px 30% 0);
    transform: translate(-10px, 10px);
  }

  80% {
    clip-path: inset(80% -6px 5% 0);
    transform: translate(20px, -10px);
  }

  90% {
    clip-path: inset(80% -6px 0 0);
    transform: translate(-10px, 0px);
  }

  100% {
    clip-path: inset(80% -6px 0 0);
    transform: translate(0);
  }
}
